
from django.shortcuts import render
from django.http import HttpResponse
from script import runIMEI

class for_demo(object):
    def __init__(self):
        pass

    def index(request):
        context = {
            'books': [
                {
                    'name': '三国演义',
                    'author': '罗贯中',
                    'price': '199',
                },
                {
                    'name': '水浒传',
                    'author': '施耐庵',
                    'price': '100',
                },
                {
                    'name': '西游记',
                    'author': '吴承恩',
                    'price': '200',
                },
                {
                    'name': '红楼梦',
                    'author': '曹雪芹',
                    'price': '99',
                }
            ],
            'person': {
                'username': 'zhouyi',
                'age': 30,
                'height': 180
            },
            'comments': [
                '文章真好',
                '确实好',
            ],
            'datas': [

            ]
        }
        return render(request, 'for_index.html', context=context)

    def IMEI(request):
        imei = runIMEI.genMassImei("12345678901234", 1000)
        context = {
            'imeis': [
                imei,
            ]
        }
        return render(request, "IMEI_index.html", context=context)


